package com.onec.service.manage.dto.resp;

import cn.hutool.core.date.DateUtil;
import com.onec.service.api.dto.response.BaseResponse;
import com.onec.service.api.enums.ResultCodeEnum;
import com.onec.service.api.enums.StatusEnum;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;

/**
 * 用户数据信息dto
 *
 * @author onec
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class UserInfoResp extends BaseResponse {

    private Long id;

    private Integer version;


    private String userName;

    private String token;


    private String phone;


    private String email;


    private String salt;


    private String password;


    private String userNo;


    private StatusEnum status;

    private String createTime;

    private String updateTime;

    private String expireTime;

    public UserInfoResp() {
    }

    public UserInfoResp(ResultCodeEnum resultCodeEnum, String token, String userName, Date expireTime) {
        super(resultCodeEnum.getCode(), resultCodeEnum.getMessage());
        this.token = token;
        this.userName = userName;
        this.expireTime = DateUtil.formatDateTime(expireTime);
    }
}
